(function($) {
	$(document).ready(function(e) {
		
		initFormById();
		$("#examquestions-type").change(function () {
			initFormById();
		});
		
		function initFormById(){
			//题型不同 切换表单 +++++++ xiaowan 切换存在问题 多个ExamQuestions[answer]
			var sectionsid = parseInt($("#examquestions-type").val());
			console.log($("#answer3 [name='ExamQuestions[answer]']").size());
//			console.log($("#answer2 :input"));
			switch (sectionsid)
			{
				case 1:
					$("[name*='ExamQuestions[answer]']").attr("disabled",true);
					$("#answer2").hide();
					$("#answer3").hide();
					$("#answer4").hide();
					
					$("#answer1").show();
					$("#answer1 input").attr("disabled",false);
					$(".field-examquestions-select").show();
					$(".field-examquestions-selectnumber").show();

					break;
				case 2:
					$("[name*='ExamQuestions[answer]']").attr("disabled",true);
					$("#answer1").hide();
					$("#answer3").hide();
					$("#answer4").hide();
					
					$("#answer2").show();
					$("#answer2 input").attr("disabled",false);
					$(".field-examquestions-select").show();
					$(".field-examquestions-selectnumber").show();

					break;
				case 3:
					$("[name*='ExamQuestions[answer]']").attr("disabled",true);
					$("#answer1").hide();
					$("#answer2").hide();
					$("#answer4").hide();
					
					$("#answer3").show();
					$("#answer3 [name='ExamQuestions[answer]']").attr("disabled",false);
					$(".field-examquestions-select").hide();
					$(".field-examquestions-selectnumber").hide();
					break;
				case 4:
					
				case 5:
					$("[name*='ExamQuestions[answer]']").attr("disabled",true);
					$("#answer1").hide();
					$("#answer2").hide();
					$("#answer3").hide();
					
					$("#answer4").show();
					$("#answer4 [name='ExamQuestions[answer]']").attr("disabled",false);
					$(".field-examquestions-select").hide();
					$(".field-examquestions-selectnumber").hide();
				  	break;
				default:
					  alert("请选择题型");
			}
			
		
	  }

	});
}) (jQuery);